package com.drg.center.entity.enums;

/**
 *  资源类型枚举类
 * @Author: zhangxilin
 * @Date: 2021/11/5
 */
public enum ResTypeEnum {

    menu(0,"菜单"),

    button(1,"按钮"),

    directory(2, "目录"),

    ;

    private Integer code;

    private String desc;


    public static ResTypeEnum getByCode(Integer code){
        for (ResTypeEnum enums : ResTypeEnum.values()){
            if (enums.getCode().equals(code)){
                return enums;
            }
        }
        return  null;
    }

    ResTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
